/**
 * 
 */
package ar.edu.unq.tpi.uis.tepe3.dominio;

import java.util.List;

/**
 * @author daniel
 *
 */
public abstract class Grantable {
	
	private String identifierName;
	@SuppressWarnings("unused")
	//No quiero agregar o quitar la lista completa, la idea es acceder a cada permiso
	private List<Privilege> privileges;

	/**
	 * 
	 */
	public Grantable() {
		super();
	}
	
	public Grantable(String aName) {
		super();
		this.setIdentifierName(aName);
	}

	/**
	 * @param identifierName the identifierName to set
	 */
	public void setIdentifierName(String identifierName) {
		this.identifierName = identifierName;
	}

	/**
	 * @return the identifierName
	 */
	public String getIdentifierName() {
		return identifierName;
	}
	
	public void addPrivilege(Privilege elPermiso){
		this.privileges.add(elPermiso);
	}
	
	public Boolean hasPrivilege(Privilege elPrivilege){
		return this.privileges.contains(elPrivilege);
	}
	

	
	
	

}
